package com.hiss.basic.model.system.domain;

import com.hiss.basic.starter.mybatis.constant.DataSourceConstant;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 系统登录日志 domain
 */
@Data
@Table(value = "sys_login_log", dataSource = DataSourceConstant.DEFAULT_DATASOURCE)
public class SysLoginLogDomain implements Serializable {

    private static final long serialVersionUID = 1;

    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 操作系统
     */
    private String os;

    /**
     * 浏览器类型
     */
    private String browser;

    /**
     * IP 地址
     */
    private String ip;

    /**
     * 登录状态： 0 成功 1 失败
     */
    private Integer status;

    /**
     * 登录时间
     */
    private LocalDateTime loginTime;

    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    @Column(onUpdateValue = "now()")
    private LocalDateTime updateTime;
}
